﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace MovieRental.XmlDataProviderCore.Configuration
{
    internal class XmlDataProviderConfiguration : ConfigurationSection
    {
        private const string defaultworkingDirectory = "Data";
        private const string defaultInitializationMode = "Open";

        [ConfigurationProperty("workingDirectory", IsRequired = true, DefaultValue = defaultworkingDirectory)]
        public string WorkingDirectory
        {
            get { return (string)base["workingDirectory"]; }
            set { base["workingDirectory"] = value; }
        }

        [ConfigurationProperty("initializationMode", IsRequired = true, DefaultValue = defaultInitializationMode)]
        public InitializationMode Mode
        {
            get { return (InitializationMode) base["initializationMode"]; }
            set { base["initializationMode"] = value.ToString(); }
        }
    }
}
